﻿//var car1 = {
//    year: 2000,
//    make: 'Ford',
//    model: 'Fusion',
//    repairs: ['repair1', 'repair2', 'repair3'],
//    getInfo: function () {
//        return 'Vehicle: ' + this.year + ' ' + this.make + ' ' + this.model;
//    }
//}

//var car2 = {
//    year: 2010,
//    make: 'BMW',
//    model: 'Z4',
//    getInfo: function () {
//        return 'Vehicle: ' + this.year + ' ' + this.make + ' ' + this.model;
//    }
//}

//function getVehicle(theYear, theMake, theModel) {
//    var vehicle = new Object();
//    vehicle.year = theYear;
//    vehicle.make = theMake;
//    vehicle.model = theModel;
//    vehicle.getInfo = function () {
//        return 'Vehicle: ' + this.year + ' ' + this.make + ' ' + this.model;
//    };
//    return vehicle;
//}

//function Vehicle(theYear, theMake, theModel) {
//    var year = theYear;
//    var make = theMake;
//    var model = theModel;
//    this.getYear = function () { return year; };
//    this.getMake = function () { return make; };
//    this.getModel = function () { return model; };
//}
//Vehicle.prototype.getInfo = function () {
//    return 'Vehicle: ' + this.getYear() + ' ' + this.getMake() + ' ' + this.getModel();
//}

//(function () {
this.myApp = this.myApp || {};
var rootNs = this.myApp;

var Vehicle = (function () {
    function Vehicle(year, make, model) {
        this.year = year;
        this.make = make;
        this.model = model;
    }
    Vehicle.prototype.getInfo = function () {
        return this.year + ' ' + this.make + ' ' + this.model;
    };
    Vehicle.prototype.startEngine = function () {
        return 'Vroom';
    };
    return Vehicle;
}());
var Car = (function (parent) {
    Car.prototype = new Vehicle();
    Car.prototype.constructor = Car;
    function Car(year, make, model) {
        this.wheelQuantity = 4;
        parent.call(this, year, make, model);
    }
    Car.prototype.getInfo = function () {
        return 'Vehicle Type: Car ' + parent.prototype.getInfo.call(this);
    }
    return Car;
})(Vehicle);
var Boat = (function (parent) {
    Boat.prototype = new Vehicle();
    Boat.prototype.constructor = Boat;
    function Boat(year, make, model) {
        this.propellerBladeQuantity = 3;
        parent.call(this, year, make, model);
    }
    Boat.prototype.getInfo = function () {
        return 'Vehicle Type: Boat ' + parent.prototype.getInfo.call(this);
    }
    return Boat;
})(Vehicle);
//var vehicleCount = 5;
//var vehicles = new Array();

//rootNs.Car = function () { };
//rootNs.Truck = function () { };

//var repair = {
//    description: 'changed spark plugs',
//    cost: 100
//};

//rootNs.billing = rootNs.billing || {};
//var ns = rootNs.billing;

//this.TaxRate = .05;
//var taxRate = .05;

//ns.invoice = function () { };
//}());